<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var a = [];
        for (var i = 0; i < 5; i++) {
            a[i] = Number(prompt('请输入一个数'));
        }

        // console.log(a);
        for (var i = 0; i < a.length - 1; i++) {
            for (j = 0; j < a.length - i - 1; j++) {
                if (a[j] < a[j + 1]) {
                    var k = a[j];
                    a[j] = a[j + 1];
                    a[j + 1] = k;
                }
            }
        }
        console.log('over');
        console.log(a);

    </script>
</head>

<body>

</body>

</html>